package com.csgc.camera.constants


import android.content.Context
import androidx.core.content.ContextCompat
import com.csgc.camera.bean.FilterStyle
import com.cysd.spsyxj.R


object Constants {


    /**
     * 友盟
     */

    enum class UMengSDK(val id: String) {
        //id
        APPID("")
    }

    /**
     * 广告ID相关
     */
    enum class GromoreSDK(val id: String) {
        APPID(""),
        splashAdId(""),
        interstitialAdId(""),
        rewardAdId(""),
        feedAdId(""),
    }


    /**
     * 滤镜
     */
    val filterStyle = listOf(
        FilterStyle("无滤镜", R.drawable.img_no_filter, style = ""),
        FilterStyle("小美好", R.drawable.img_filter_1, "@adjust lut filmstock.png"),
        FilterStyle("荧光蓝", R.drawable.img_filter_1, "@adjust lut wildbird.png"),
        FilterStyle(
            "金秋",
            R.drawable.img_filter_1,
            "@curve R(0, 0)(71, 74)(164, 165)(255, 255) @pixblend screen 0.94118 0.29 0.29 1 20"
        ),
        FilterStyle(
            "山行",
            R.drawable.img_filter_1,
            "@curve B(0, 0)(68, 72)(149, 184)(255, 255) @pixblend screen 0.94118 0.29 0.29 1 20"
        ),
        FilterStyle(
            "雾霾蓝",
            R.drawable.img_filter_1,
            "@curve B(0, 0)(70, 87)(140, 191)(255, 255) @pixblend pinlight 0.247 0.49 0.894 1 20"
        ),
        FilterStyle(
            "青森",
            R.drawable.img_filter_1,
            "@adjust hsv -0.7 -0.7 0.5 -0.7 -0.7 0.5 @pixblend ol 0.243 0.07059 0.59215 1 25"
        ),
        FilterStyle(
            "烈日",
            R.drawable.img_filter_1,
            "@adjust hsv 0.3 -0.5 -0.3 0 0.35 -0.2 @curve R(0, 0)(111, 163)(255, 255)G(0, 0)(72, 56)(155, 190)(255, 255)B(0, 0)(103, 70)(212, 244)(255, 255)"
        ),
        FilterStyle("暗调", R.drawable.img_filter_1, "@adjust hsv -1 -1 -1 -1 -1 -1"),
        FilterStyle(
            "清新",
            R.drawable.img_filter_1,
            "@curve R(2, 2)(16, 30)(72, 112)(135, 185)(252, 255)G(2, 1)(30, 42)(55, 84)(157, 207)(238, 249)B(1, 0)(26, 17)(67, 106)(114, 165)(231, 250)"
        ),
        FilterStyle(
            "盐调",
            R.drawable.img_filter_1,
            "@adjust hsl 0.02 -0.31 -0.17 @curve R(0, 28)(23, 45)(117, 148)(135, 162)G(0, 8)(131, 152)(255, 255)B(0, 17)(58, 80)(132, 131)(127, 131)(255, 225)"
        ),
        FilterStyle("模糊", R.drawable.img_filter_1, "#unpack @blur lerp 0.75"),
        FilterStyle("磨皮", R.drawable.img_filter_1, "@beautify bilateral 100 3.5 2"),
        FilterStyle(
            "梦幻",
            R.drawable.img_filter_1,
            "@curve R(0, 0)(71, 74)(164, 165)(255, 255) @pixblend overlay 0.357 0.863 0.882 1 40"
        ),
        FilterStyle(
            "烟雨",
            R.drawable.img_filter_1,
            "@curve R(0, 0)(149, 145)(255, 255)G(0, 0)(149, 145)(255, 255)B(0, 0)(149, 145)(255, 255) @pixblend colordodge 0.937 0.482 0.835 1 20"
        ),


        FilterStyle(
            "神鹿",
            R.drawable.img_filter_1,
            "@curve R(0, 0)(71, 74)(164, 165)(255, 255) @pixblend overlay 0.357 0.863 0.882 1 40"
        ),
        FilterStyle(
            "丝路",
            R.drawable.img_filter_1,
            "@curve R(0, 0)(152, 183)(255, 255)G(0, 0)(161, 133)(255, 255) @pixblend overlay 0.357 0.863 0.882 1 40"
        ),
        FilterStyle(
            "新叶",
            R.drawable.img_filter_1,
            "@adjust saturation 0.7 @pixblend screen 0.8112 0.243 1 1 40"
        ),
        FilterStyle(
            "曝光",
            R.drawable.img_filter_1,
            "@curve R(0, 0)(69, 63)(105, 138)(151, 222)(255, 255)G(0, 0)(67, 51)(135, 191)(255, 255)B(0, 0)(86, 76)(150, 212)(255, 255)"
        ),
        FilterStyle(
            "古铜",
            R.drawable.img_filter_1,
            "@curve R(0, 0)(43, 77)(56, 104)(100, 166)(255, 255)G(0, 0)(35, 53)(255, 255)B(0, 0)(110, 123)(255, 212)"
        ),
        FilterStyle(
            "暖灰",
            R.drawable.img_filter_1,
            "@curve R(15, 0)(92, 133)(255, 234)G(0, 20)(105, 128)(255, 255)B(0, 0)(120, 132)(255, 214)"
        ),
        FilterStyle(
            "落日",
            R.drawable.img_filter_1,
            "@curve R(5, 49)(85, 173)(184, 249)G(23, 35)(65, 76)(129, 145)(255, 199)B(74, 69)(158, 107)(255, 126)"
        ),
        FilterStyle(
            "冷静",
            R.drawable.img_filter_1,
            "@adjust hsv -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 @curve R(0, 0)(129, 148)(255, 255)G(0, 0)(92, 77)(175, 189)(255, 255)B(0, 0)(163, 144)(255, 255)"
        ),
        FilterStyle(
            "热情",
            R.drawable.img_filter_1,
            "@curve R(40, 40)(86, 148)(255, 255)G(0, 28)(67, 140)(142, 214)(255, 255)B(0, 100)(103, 176)(195, 174)(255, 255) @adjust hsv 0.32 0 -0.5 -0.2 0 -0.4"
        ),
        FilterStyle(
            "冷色",
            R.drawable.img_filter_1,
            "@curve R(4, 35)(65, 82)(117, 148)(153, 208)(206, 255)G(13, 5)(74, 78)(109, 144)(156, 201)(250, 250)B(6, 37)(93, 104)(163, 184)(238, 222)(255, 237) @adjust hsv -0.2 -0.2 -0.44 -0.2 -0.2 -0.2"
        ),
    )

    val newfilterStyle = listOf(
        FilterStyle(name = "", drawable = R.drawable.ic_filter_bg_1, style = ""),
        FilterStyle(
            "",
            R.drawable.ic_filter_bg_2,
            "@curve R(0, 0)(71, 74)(164, 165)(255, 255) @pixblend screen 0.94118 0.29 0.29 1 20"
        ),
        FilterStyle(
            "",
            R.drawable.ic_filter_bg_3,
            "@curve R(0, 0)(43, 77)(56, 104)(100, 166)(255, 255)G(0, 0)(35, 53)(255, 255)B(0, 0)(110, 123)(255, 212)"
        ),
        FilterStyle(
            "",
            R.drawable.ic_filter_bg_4,
            "@adjust hsv -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 @curve R(0, 0)(129, 148)(255, 255)G(0, 0)(92, 77)(175, 189)(255, 255)B(0, 0)(163, 144)(255, 255)"
        ),
        FilterStyle(
            "", R.drawable.ic_filter_bg_5,
            "@curve R(0, 0)(160, 160)(255, 255)G(0, 0)(230, 230)(255, 255)B(0, 0)(143, 143)(255, 255) @pixblend colordodge 0.627 0.902 0.561 1 20"
        ),
        FilterStyle(
            "",
            R.drawable.ic_filter_bg_6,
            "@curve R(0, 0)(135, 135)(255, 255)G(0, 0)(227, 227)(255, 255)B(0, 0)(144, 144)(255, 255) @pixblend colordodge 0.529 0.890 0.565 1 20"
        ),
        FilterStyle(
            "",
            R.drawable.ic_filter_bg_7,
            "@curve B(0, 0)(70, 87)(140, 191)(255, 255) @pixblend pinlight 0.247 0.49 0.894 1 20"
        ),
        FilterStyle(
            "",
            R.drawable.ic_filter_bg_8,
            "@curve R(0, 0)(146, 146)(255, 255)G(0, 0)(105, 105)(255, 255)B(0, 0)(232, 232)(255, 255) @pixblend colordodge 0.573 0.412 0.910 1 20"
        ),
    )


    //无水印图片缓存
    const val NO_MASK_CACHE_IMAGE = "noMaskImage"

    //有水印缓存
    const val HAVE_MASK_CACHE_IMAGE = "MaskCacheImage"

    //水印图--视频添加使用
    const val MASK_CACHE_IMAGE = "maskImage"

    //视频临时存储
    const val MASK_RECORD_VIDEO = "record_video"

    //拼图临时存储
    const val PUZZLE_CACHE_IMAGE = "puzzleImage"


    enum class PrivacyUrl(val url: String) {
        //隐私政策
        privacy("https://tools.hnyynet.com.cn/ruoyi-admin/profile/agreement/syxj_mksyxj/ysxy.html"),

        //用户协议
        protocol("https://tools.hnyynet.com.cn/ruoyi-admin/profile/agreement/syxj_mksyxj/yhxy.html"),

        //会员协议
        memberProtocol(""),

        //自动续费
        autoRenewalRule("")
    }

    fun getVipTxt(type: Int): String {
        return when (type) {
            1 -> {
                "永久会员"
            }

            2 -> {
                "连续包年"
            }

            3 -> {
                "连续包季"
            }

            4 -> {
                "连续包月"
            }

            else -> {
                "临时会员"
            }
        }
    }


    public fun getChangeColor(context: Context, active: Int): Int {
        return if (active == 1) {
            ContextCompat.getColor(context, R.color.white)
        } else if (active == 2) {
            ContextCompat.getColor(context, R.color.black)
        } else if (active == 3) {
            ContextCompat.getColor(context, R.color.color_FFE17D)
        } else if (active == 4) {
            ContextCompat.getColor(context, R.color.color_c9a0ff)
        } else if (active == 5) {
            ContextCompat.getColor(context, R.color.color_95ccFd)
        } else if (active == 6) {
            ContextCompat.getColor(context, R.color.color_fe7da8)
        } else if (active == 7) {
            ContextCompat.getColor(context, R.color.color_7dffa4)
        } else if (active == 8) {
            ContextCompat.getColor(context, R.color.color_679905)
        } else {
            ContextCompat.getColor(context, R.color.white)
        }

    }

    //临时会员到期
    const val tempVipTime = 10 * 60 * 1000


    //微信授权方式
    enum class WXAuthType(val state: String) {
        LOGIN("camera_login"),
        BIND("camera_bind")
    }
}